Skip to content

[FIXED] KeyStore exception android.os.ServiceSpecificException: (code 7)#42

Open
ajdevy wants to merge 1 commit into
iamMehedi:masterfrom
ajdevy:bugfix/keystore_exception
Open

[FIXED] KeyStore exception android.os.ServiceSpecificException: (code 7)#42
ajdevy wants to merge 1 commit into
iamMehedi:masterfrom
ajdevy:bugfix/keystore_exception

Conversation

@ajdevy

@ajdevy ajdevy commented Nov 15, 2018

Copy link
Copy Markdown

Fixed secure preferences initialization with Android KeyStore, as described in https://stackoverflow.com/questions/52024752/android-p-keystore-exception-android-os-servicespecificexception?rq=1

@EdgarJan EdgarJan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still getting same Exception on Android P caused by entryInstanceOf.

@ajdevy

ajdevy commented Dec 16, 2018

Copy link
Copy Markdown
Author

@EdgarJan can you give a bit more details?

@EdgarJan

Copy link
Copy Markdown

@EdgarJan can you give a bit more details?

W/KeyStore: KeyStore exception
    android.os.ServiceSpecificException:  (code 7)
        at android.os.Parcel.createException(Parcel.java:1956)
        at android.os.Parcel.readException(Parcel.java:1910)
        at android.os.Parcel.readException(Parcel.java:1860)
        at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
        at android.security.KeyStore.get(KeyStore.java:195)
        at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:144)
        at java.security.KeyStoreSpi.engineEntryInstanceOf(KeyStoreSpi.java:583)
        at java.security.KeyStore.entryInstanceOf(KeyStore.java:1631)
        at devliving.online.securedpreferencestore.EncryptionManager.loadKey(EncryptionManager.java:690)
        at devliving.online.securedpreferencestore.EncryptionManager.setup(EncryptionManager.java:228)
        at devliving.online.securedpreferencestore.EncryptionManager.<init>(EncryptionManager.java:201)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.<init>(SecuredPreferenceStore.java:79)
        at devliving.online.securedpreferencestore.SecuredPreferenceStore.init(SecuredPreferenceStore.java:134)

I suggest remove check for mStore.entryInstanceOf(AES_KEY_ALIAS, KeyStore.SecretKeyEntry.class).

@alexpwf alexpwf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems correct to me.

@BlueHeisenberg

Copy link
Copy Markdown

Why is this not merged already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants